package com.example.springconfigfile.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/properties")
public class PropertiesController {
    @Value("${mykey.key1}")
    private String myKey1;

    @ResponseBody
    @RequestMapping("/key")
    public String key() {
        return "读取到key值为: " + myKey1;
    }
}
